package com.gitee.ywj1352.bootDemo;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Configuration;

/**
 * Created by wenjie.yang on 2019/7/12.
 */
@Configuration
public class SpringAnnApplication {


    public static void main(String[] args) {
        //创建 注解上下文容器  还有xml 的容器GenericXmlApplicationContext
        AnnotationConfigApplicationContext ann = new AnnotationConfigApplicationContext();
        // 注册 一个 配置类
        ann.register(SpringAnnApplication.class);

        //启动上下文
        ann.refresh();

        SpringAnnApplication bean = ann.getBean(SpringAnnApplication.class);
        System.out.println(bean);

    }
}
